package com.jy.wms.common.base;

/**
 * Created by yjs on 2018/7/14.
 */
public class Pageing {
    private Integer page;
    private Integer rows;

    public Integer getPage() {
        return page;
    }

    public void setPage(Integer page) {
        this.page = page;
    }

    public Integer getRows() {
        return rows;
    }

    public void setRows(Integer rows) {
        this.rows = rows;
    }
    //创建 SingleObject 的一个对象
    private static Pageing pageing = new Pageing();

    //让构造函数为 private，这样该类就不会被实例化
    private Pageing(){}

    //获取唯一可用的对象
    public static Pageing getPageing(Integer page, Integer rows){
        pageing.setPage((page - 1) * rows);
        pageing.setRows(rows);
        return pageing;
    }
}
